package com.ldp.designpatterns.study.single.hungry;

/**
 * @ClassName HungrySignle
 * @Description 单例模式——饿汉式（静态代码块写法）
 * @Author lindipei
 * @Date 2023/10/13 16:48
 */
public class HungryStaitcCodeSignle {
   /* //1、构造器私有化，外部能new
    private HungryStaitcCodeSignle(){

    }
    //2、本类内部创建对象实例
    private static HungryStaitcCodeSignle instance;

    //3、在静态代码快中，创建单例对象
    static {
        instance = new HungryStaitcCodeSignle();
    }

    //4、向外暴露一个静态的公共方法。getInstance
    public static HungryStaitcCodeSignle getInstance(){
        return instance;
    }*/
}
